/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.tedu.mall.ams.service;

import cn.tedu.mall.common.pojo.admin.dto.AdminAddDTO;
import cn.tedu.mall.common.pojo.admin.dto.AdminQueryDTO;
import cn.tedu.mall.common.pojo.admin.dto.AdminUpdateDTO;
import cn.tedu.mall.common.pojo.admin.vo.AdminVO;
import cn.tedu.mall.common.restful.JsonPage;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 管理员表 服务类
 * </p>
 *
 * @since 2021-12-02
 */
public interface IAdminService {
    /**
     * 分页查询
     *
     * @param pageNum
     * @param sizeNum
     * @return
     */
    JsonPage<AdminVO> listAdmins(
        Integer pageNum,
        Integer sizeNum
    );

    /**
     * 新增用户
     *
     * @param adminDTO
     */
    void addAdmin(AdminAddDTO adminDTO);

    /**
     * 模糊查询用户
     *
     * @param pageNum
     * @param sizeNum
     * @param query
     * @return
     */
    JsonPage<AdminVO> queryAdmins(
        Integer pageNum,
        Integer sizeNum,
        String query
    );

    /**
     * 更新用户
     *
     * @param adminUpdateDTO
     */
    @Transactional
    void updateAdmin(AdminUpdateDTO adminUpdateDTO);

    /**
     * 删除用户
     *
     * @param id
     */
    @Transactional
    void deleteAdmin(Long id);

    AdminVO queryOneAdmin(String username);

    void enableAdmin(
        Long id,
        Integer enable
    );

    JsonPage<AdminVO> queryListAdmin(AdminQueryDTO adminQueryDTO);
}
